<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>Docker 部署 SpringBoot 项目 | MoneyLee’s Blog</title><meta name="author" content="李财"><meta name="copyright" content="李财"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="CentOS 安装 Docker 使用官方脚本自动安装 curl -fsSL https:&#x2F;&#x2F;get.docker.com | bash -s docker --mirror Aliyun   国内 daocloud 一键安装命令: curl -sSL https:&#x2F;&#x2F;get.daocloud.io&#x2F;docker | sh   离线安装(未涉及) docker地址 可以查找想要的仓库  但是得先注">
<meta property="og:type" content="article">
<meta property="og:title" content="Docker 部署 SpringBoot 项目">
<meta property="og:url" content="https://moneylee.gitee.io/myblog/2020/08/18/Docker%E9%83%A8%E7%BD%B2SpringBoot%E9%A1%B9%E7%9B%AE/index.html">
<meta property="og:site_name" content="MoneyLee’s Blog">
<meta property="og:description" content="CentOS 安装 Docker 使用官方脚本自动安装 curl -fsSL https:&#x2F;&#x2F;get.docker.com | bash -s docker --mirror Aliyun   国内 daocloud 一键安装命令: curl -sSL https:&#x2F;&#x2F;get.daocloud.io&#x2F;docker | sh   离线安装(未涉及) docker地址 可以查找想要的仓库  但是得先注">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl4zhjzuj30qy0e0gyz.jpg">
<meta property="article:published_time" content="2020-08-18T05:12:02.000Z">
<meta property="article:modified_time" content="2020-08-25T02:56:37.000Z">
<meta property="article:author" content="李财">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl4zhjzuj30qy0e0gyz.jpg"><link rel="shortcut icon" href="/myblog/img/favicon.png"><link rel="canonical" href="https://moneylee.gitee.io/myblog/2020/08/18/Docker%E9%83%A8%E7%BD%B2SpringBoot%E9%A1%B9%E7%9B%AE/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/myblog/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/myblog/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'Docker 部署 SpringBoot 项目',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2020-08-25 10:56:37'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.0.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data is-center"><div class="data-item"><a href="/myblog/archives/"><div class="headline">文章</div><div class="length-num">46</div></a></div><div class="data-item"><a href="/myblog/tags/"><div class="headline">标签</div><div class="length-num">0</div></a></div><div class="data-item"><a href="/myblog/categories/"><div class="headline">分类</div><div class="length-num">10</div></a></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/myblog/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 影音</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/myblog/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/myblog/movies/"><i class="fa-fw fas fa-video"></i><span> 电影</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/myblog/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl4zhjzuj30qy0e0gyz.jpg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/myblog/">MoneyLee’s Blog</a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/myblog/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 影音</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/myblog/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/myblog/movies/"><i class="fa-fw fas fa-video"></i><span> 电影</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/myblog/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">Docker 部署 SpringBoot 项目</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2020-08-18T05:12:02.000Z" title="发表于 2020-08-18 13:12:02">2020-08-18</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2020-08-25T02:56:37.000Z" title="更新于 2020-08-25 10:56:37">2020-08-25</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/myblog/categories/Docker/">Docker</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="Docker 部署 SpringBoot 项目"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h3 id="CentOS-安装-Docker"><a href="#CentOS-安装-Docker" class="headerlink" title="CentOS 安装 Docker"></a>CentOS 安装 Docker</h3><ul>
<li>使用官方脚本自动安装<ul>
<li><code>curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun</code></li>
</ul>
</li>
<li>国内 daocloud 一键安装命令:<ul>
<li><code>curl -sSL https://get.daocloud.io/docker | sh</code></li>
</ul>
</li>
<li>离线安装(未涉及)</li>
<li><a target="_blank" rel="noopener" href="https://hub.docker.com/">docker地址</a> 可以查找想要的仓库</li>
</ul>
<p>但是得先注册账号 登录后再打开这个地址</p>
<h3 id="启动Docker-amp-设置为开机自启"><a href="#启动Docker-amp-设置为开机自启" class="headerlink" title="启动Docker &amp; 设置为开机自启"></a>启动Docker &amp; 设置为开机自启</h3><ul>
<li><code>sudo systemctl start docker</code></li>
<li><code>sudo systemctl enable docker.service</code></li>
<li>查看docker版本 <code>docker version</code></li>
</ul>
<h3 id="Docker-安装-MySql-5-7-如果不写-5-7-则默认拉取最新版本"><a href="#Docker-安装-MySql-5-7-如果不写-5-7-则默认拉取最新版本" class="headerlink" title="Docker 安装 MySql 5.7 如果不写:5.7 则默认拉取最新版本"></a>Docker 安装 MySql 5.7 如果不写:5.7 则默认拉取最新版本</h3><ul>
<li><code>docker pull mysql:5.7</code></li>
</ul>
<h3 id="创建并启动一个MySql-容器"><a href="#创建并启动一个MySql-容器" class="headerlink" title="创建并启动一个MySql 容器"></a>创建并启动一个MySql 容器</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker run --name mysqlserver -e MYSQL_ROOT_PASSWORD=123456 -p 3307:3306 -d --restart=always mysql</span><br></pre></td></tr></table></figure>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">–name：给新创建的容器命名，此处命名为mysqlserver</span><br><span class="line">-e：配置信息，此处配置mysql的root用户的登陆密码</span><br><span class="line">-p：端口映射，表示在这个容器中使用3306端口(第二个)映射到本机的端口号也为3306(第一个)</span><br><span class="line">-d：成功启动容器后输出容器的完整ID</span><br><span class="line">--restart=always: 重启策略 docker启动时自动启动mysql容器</span><br><span class="line">最后一个mysql指的是mysql镜像名字 我这里同时安装了mysql8和5.7 镜像名都是mysql, 所以我在启动时用的容器ID</span><br><span class="line">718a6da099d8</span><br><span class="line">--restart=on-failure:3：是指容器在未来出现异常退出（退出码非0）的情况下循环重启3次</span><br></pre></td></tr></table></figure>

<p><img src="https://tva1.sinaimg.cn/large/007S8ZIlly1ghv11g9iajj31ty09kwhm.jpg" alt="截屏2020-08-18 下午4.06.37"></p>
<p>###测试安装是否成功</p>
<ul>
<li><p>查看docker容器列表 <code>docker ps -a</code>  看上图</p>
</li>
<li><p>进入mysql容器 <code>docker exec -it mysqlserver bash</code></p>
</li>
</ul>
<p><img src="https://tva1.sinaimg.cn/large/007S8ZIlly1ghuvsamk7bj30xm02ejrp.jpg" alt="截屏2020-08-18 下午1.04.49"></p>
<ul>
<li>开始mysql操作 <code>mysql -uroot -p123456</code></li>
</ul>
<p><img src="https://tva1.sinaimg.cn/large/007S8ZIlly1ghuvuq6ir4j30y20cmwgq.jpg" alt="截屏2020-08-18 下午1.06.37"></p>
<h3 id="开启外网访问权限"><a href="#开启外网访问权限" class="headerlink" title="开启外网访问权限"></a>开启外网访问权限</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">use mysql</span><br><span class="line">update user set password_expired = &quot;Y&quot;where user=&quot;root&quot;;</span><br><span class="line">ALTER USER&#x27;root&#x27;@&#x27;%&#x27; IDENTIFIED WITH mysql_native_password BY &#x27;123456&#x27;;</span><br><span class="line">flush privileges;</span><br></pre></td></tr></table></figure>

<p>退出mysql 退出mysql容器 并重启容器服务</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">exit</span></span><br><span class="line"><span class="built_in">exit</span></span><br><span class="line">docker restart mysqlserver</span><br></pre></td></tr></table></figure>

<p>使用远程连接工具尝试连接,注意云服务器安全组配置, 本片文章3307 入网规则放开</p>
<h3 id="挂载数据卷以及配置文件"><a href="#挂载数据卷以及配置文件" class="headerlink" title="挂载数据卷以及配置文件"></a>挂载数据卷以及配置文件</h3><p>之所以放在这里, 毕竟是一片学习教程文章. 一开始整太多不容易理解. 首先为什么需要挂载数据卷及配置文件.</p>
<p>如果我们在容器内操作mysql配置不是很方便,再一个如果容器被删除了,那么数据也会丢失. 我们需要把容器内的mysql配置文件和数据挂载到宿主机上</p>
<p>首先在宿主机内创建两个文件夹 习惯在 根目录创建 /mnt</p>
<p>mnt下创建docker文件夹 docker内创建一个mysql  mysql下创建 conf和data两个文件夹</p>
<p>一个存放配置文件 一个存放数据</p>
<p>对了 我们忘了去看下mysql容器内配置文件的位置, 虽然默认位置都在/etc/mysql/my.cnf 但是还是要确认下</p>
<p><img src="https://tva1.sinaimg.cn/large/007S8ZIlly1ghv1npsmk9j31so06sac3.jpg" alt="截屏2020-08-18 下午4.28.05"></p>
<p>创建my.conf配置文件</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">touch /mnt/mysql/my.cnf</span><br></pre></td></tr></table></figure>

<p>My.cnf添加如下内容:</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">[mysqld]</span><br><span class="line">user=mysql</span><br><span class="line">character-set-server=utf8mb4</span><br><span class="line">default_authentication_plugin=mysql_native_password</span><br><span class="line">secure_file_priv=/var/lib/mysql</span><br><span class="line">expire_logs_days=7</span><br><span class="line">sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION</span><br><span class="line">max_connections=1000</span><br><span class="line">secure_file_priv=/var/lib/mysql</span><br><span class="line">[client]</span><br><span class="line">default-character-set=utf8mb4</span><br><span class="line"></span><br><span class="line">[mysql]</span><br><span class="line">default-character-set=utf8mb4</span><br></pre></td></tr></table></figure>



<h3 id="重新创建MySql容器并启动"><a href="#重新创建MySql容器并启动" class="headerlink" title="重新创建MySql容器并启动"></a>重新创建MySql容器并启动</h3><p>删除之前的mysql容器</p>
<p><img src="https://tva1.sinaimg.cn/large/007S8ZIlly1ghv20b1sktj31ry074dhr.jpg" alt="截屏2020-08-18 下午4.40.11"></p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">docker run --name mysqlserver \</span><br><span class="line">-e MYSQL_ROOT_PASSWORD=123456 \</span><br><span class="line">-p 3307:3306 \</span><br><span class="line">-v /mnt/docker/mysql/conf:/etc/mysql/conf.d \</span><br><span class="line">-v /mnt/docker/mysql/data:/var/lib/mysql \</span><br><span class="line">--restart=always \</span><br><span class="line">-d 718a6da099d8</span><br></pre></td></tr></table></figure>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">结合参考之前的</span><br><span class="line">-v：绑定挂</span><br><span class="line">--restart=on-failure:3：是指容器在未来出现异常退出（退出码非0）的情况下循环重启3次</span><br><span class="line">-d：后台运行容器，并返回容器 id  718a6da099d8是我镜像的ID 因为有两个mysql版本</span><br></pre></td></tr></table></figure>

<p>这样就可以通过修改宿主机的配置文件修改mysql容器内的数据库配置了,并且如果删除了mysql容器,也可以通过挂载在宿主机的数据卷进行恢复,当然最好别这么操作. 有时间再写一篇容器删除的情况加如果数据恢复和自动备份操作的文章</p>
<h3 id="将本地测试数据库导入到服务器Mysql数据库"><a href="#将本地测试数据库导入到服务器Mysql数据库" class="headerlink" title="将本地测试数据库导入到服务器Mysql数据库"></a>将本地测试数据库导入到服务器Mysql数据库</h3><p>获取mysql备份文件</p>
<p>这里有个注意点: 如果提示你密码过于简单 需要重新设置密码时, 你修改mysql密码完成后</p>
<p><code>alter user user() identified by “123456”;</code></p>
<p><code>flush privileges;</code></p>
<p>会发现远程连接数据库的密码发现没有改变 还是以前的密码, 这是为什么呢. 回头看你之前启动容器的命令</p>
<p><code>docker run --name mysqlserver -e MYSQL_ROOT_PASSWORD=123456 -p 3307:3306 -d --restart=always mysql</code></p>
<p>因为你指定容器的密码是123456啊 </p>
<p>将数据库备份文件传输到服务器 /mnt/temp下</p>
<p><code>scp art_boot_2020-08-18.sql root@服务器IP:/mnt/temp</code></p>
<p>在mysql容器内创建一个数据库 zsml</p>
<p><code>create database zslm default character set utf8mb4 collate utf8mb4_unicode_ci;</code></p>
<p>备份宿主机的数据到容器内的数据库内 注意是 -i 不需要伪终端</p>
<p><code>docker exec -i zslm_mysql mysql -uroot -p123456 zslm &lt; /mnt/temp/art_boot_2020-08-18.sql</code></p>
<h3 id="打包工程-获取Jar包-注意工程数据库配置文件内地址和端口"><a href="#打包工程-获取Jar包-注意工程数据库配置文件内地址和端口" class="headerlink" title="打包工程 获取Jar包 注意工程数据库配置文件内地址和端口"></a>打包工程 获取Jar包 注意工程数据库配置文件内地址和端口</h3><ul>
<li>在服务器 mnt目录下创建 docker文件夹 </li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span> /mnt</span><br><span class="line">mkdir docker</span><br></pre></td></tr></table></figure>

<h3 id="编辑Dockerfile文件"><a href="#编辑Dockerfile文件" class="headerlink" title="编辑Dockerfile文件"></a>编辑Dockerfile文件</h3><figure class="highlight dockerfile"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># Docker image for springboot file run</span></span><br><span class="line"><span class="comment"># VERSION 0.0.1</span></span><br><span class="line"><span class="comment"># Author: MoneyLee</span></span><br><span class="line"><span class="comment"># 基础镜像使用java</span></span><br><span class="line"><span class="keyword">FROM</span> java:<span class="number">8</span></span><br><span class="line"><span class="comment"># 作者</span></span><br><span class="line"><span class="keyword">MAINTAINER</span> moneylee &lt;WeChat: <span class="number">45634626</span>&gt;</span><br><span class="line"><span class="comment"># VOLUME 指定了临时文件目录为/tmp。</span></span><br><span class="line"><span class="comment"># 其效果是在主机 /var/lib/docker 目录下创建了一个临时文件，并链接到容器的/tmp</span></span><br><span class="line"><span class="keyword">VOLUME</span><span class="bash"> /tmp</span></span><br><span class="line"><span class="comment"># 将jar包添加到容器中并更名为zslm.jar</span></span><br><span class="line"><span class="keyword">ADD</span><span class="bash"> zslm.jar zslm.jar</span></span><br><span class="line"><span class="comment"># 运行jar包</span></span><br><span class="line"><span class="keyword">RUN</span><span class="bash"> bash -c <span class="string">&#x27;touch /zslm.jar&#x27;</span></span></span><br><span class="line"><span class="keyword">ENTRYPOINT</span><span class="bash"> [<span class="string">&quot;java&quot;</span>,<span class="string">&quot;-Djava.security.egd=file:/dev/./urandom&quot;</span>,<span class="string">&quot;-jar&quot;</span>,<span class="string">&quot;/zslm.jar&quot;</span>]</span></span><br></pre></td></tr></table></figure>

<hr>
<h3 id="将jar包和dockerfile文件传输到服务器的-mnt-docker-目录下"><a href="#将jar包和dockerfile文件传输到服务器的-mnt-docker-目录下" class="headerlink" title="将jar包和dockerfile文件传输到服务器的 /mnt/docker 目录下"></a>将jar包和dockerfile文件传输到服务器的 /mnt/docker 目录下</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">scp art-boot.jar root@117.78.60.169:/mnt/temp</span><br><span class="line">scp Dockerfile root@117.78.60.169:/mnt/temp</span><br></pre></td></tr></table></figure>

<hr>
<h3 id="制作镜像"><a href="#制作镜像" class="headerlink" title="制作镜像"></a>制作镜像</h3><p><strong>注意:这里要注意 java项目内数据库连接配置那块 不要写localhos 或者 127.0.0.1 因为容器之间网络是隔离的 只能通过暴露的端口联通,所以项目内的ip记得写内网ip, 还有redis那块 否则不能和数据库连通</strong></p>
<p>确保dockerfile和jar包在同一目录下 执行</p>
<p><code>docker build -t zslm .</code></p>
<p>查看镜像列表</p>
<p><img src="https://tva1.sinaimg.cn/large/007S8ZIlly1ghw4eupy9aj312207c764.jpg" alt="截屏2020-08-19 下午2.48.46"></p>
<hr>
<h3 id="Docker安装Redis-并启动服务"><a href="#Docker安装Redis-并启动服务" class="headerlink" title="Docker安装Redis 并启动服务"></a>Docker安装Redis 并启动服务</h3><p><code>docker pull redis</code></p>
<p><code>docker run --name redis-server -p 6379:6379 -d redis </code></p>
<hr>
<h3 id="启动镜像"><a href="#启动镜像" class="headerlink" title="启动镜像"></a>启动镜像</h3><p><code>docker run -d -p 9999:9999 --name zlm_server zslm</code></p>
<hr>
<h3 id="Docker-安装-Nginx"><a href="#Docker-安装-Nginx" class="headerlink" title="Docker 安装 Nginx"></a>Docker 安装 Nginx</h3><p><code>docker pull nginx</code></p>
<p>在/mnt/docker/nginx文件夹下创建挂载目录</p>
<p><code>mkdir -p /mnt/docker/nginx/&#123;conf,conf.d,html,logs&#125;</code></p>
<p>在conf.d文件夹内创建配置文件 并修改内容</p>
<p><code>cd conf</code></p>
<p><code>touch nginx.conf</code></p>
<figure class="highlight nginx"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">user</span> www-data;</span><br><span class="line"><span class="attribute">worker_processes</span> auto;</span><br><span class="line"><span class="attribute">pid</span> /run/nginx.pid;</span><br><span class="line"></span><br><span class="line"><span class="section">events</span> &#123;</span><br><span class="line">        <span class="attribute">worker_connections</span> <span class="number">768</span>;</span><br><span class="line">        <span class="comment"># multi_accept on;</span></span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="section">http</span> &#123;</span><br><span class="line"></span><br><span class="line">        <span class="comment">##</span></span><br><span class="line">        <span class="comment"># Basic Settings</span></span><br><span class="line">        <span class="comment">##</span></span><br><span class="line"></span><br><span class="line">        <span class="attribute">sendfile</span> <span class="literal">on</span>;</span><br><span class="line">        <span class="attribute">tcp_nopush</span> <span class="literal">on</span>;</span><br><span class="line">        <span class="attribute">tcp_nodelay</span> <span class="literal">on</span>;</span><br><span class="line">        <span class="attribute">keepalive_timeout</span> <span class="number">65</span>;</span><br><span class="line">        <span class="attribute">types_hash_max_size</span> <span class="number">2048</span>;</span><br><span class="line">        <span class="comment"># server_tokens off;</span></span><br><span class="line"></span><br><span class="line">        <span class="comment"># server_names_hash_bucket_size 64;</span></span><br><span class="line">        <span class="comment"># server_name_in_redirect off;</span></span><br><span class="line"></span><br><span class="line">        <span class="attribute">include</span> /etc/nginx/mime.types;</span><br><span class="line">        <span class="attribute">default_type</span> application/octet-stream;</span><br><span class="line"></span><br><span class="line">        <span class="comment">##</span></span><br><span class="line">        <span class="comment"># SSL Settings</span></span><br><span class="line">        <span class="comment">##</span></span><br><span class="line"></span><br><span class="line">        <span class="attribute">ssl_protocols</span> TLSv1 TLSv1.<span class="number">1</span> TLSv1.<span class="number">2</span>; <span class="comment"># Dropping SSLv3, ref: POODLE</span></span><br><span class="line">        <span class="attribute">ssl_prefer_server_ciphers</span> <span class="literal">on</span>;</span><br><span class="line"></span><br><span class="line">        <span class="comment">##</span></span><br><span class="line">        <span class="comment"># Logging Settings</span></span><br><span class="line">        <span class="comment">##</span></span><br><span class="line"></span><br><span class="line">        <span class="attribute">access_log</span> /var/log/nginx/access.log;</span><br><span class="line">        <span class="attribute">error_log</span> /var/log/nginx/error.log;</span><br><span class="line"></span><br><span class="line">        <span class="comment">##</span></span><br><span class="line">        <span class="comment"># Gzip Settings</span></span><br><span class="line">        <span class="comment">##</span></span><br><span class="line"></span><br><span class="line">        <span class="attribute">gzip</span> <span class="literal">on</span>;</span><br><span class="line">        <span class="attribute">gzip_disable</span> <span class="string">&quot;msie6&quot;</span>;</span><br><span class="line"></span><br><span class="line">        <span class="comment"># gzip_vary on;</span></span><br><span class="line">        <span class="comment"># gzip_proxied any;</span></span><br><span class="line">        <span class="comment"># gzip_comp_level 6;</span></span><br><span class="line">        <span class="comment"># gzip_buffers 16 8k;</span></span><br><span class="line">        <span class="comment"># gzip_http_version 1.1;</span></span><br><span class="line">        <span class="comment"># gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;</span></span><br><span class="line"></span><br><span class="line">        <span class="comment">##</span></span><br><span class="line">        <span class="comment"># Virtual Host Configs</span></span><br><span class="line">        <span class="comment">##</span></span><br><span class="line"></span><br><span class="line">        <span class="attribute">include</span> /etc/nginx/conf.d/<span class="regexp">*.conf</span>;</span><br><span class="line">        <span class="attribute">include</span> /etc/nginx/sites-enabled/*;</span><br><span class="line"></span><br><span class="line">        server&#123;</span><br><span class="line">                <span class="attribute">listen</span> <span class="number">80</span>;</span><br><span class="line">                <span class="attribute">server_name</span> your_server_name;   <span class="comment">#你的serverName</span></span><br><span class="line">                <span class="attribute">root</span> /usr/share/nginx/html;</span><br><span class="line">                <span class="attribute">index</span> index.html;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>启动镜像</p>
<figure class="highlight dockerfile"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">docker <span class="keyword">run</span><span class="bash"> \</span></span><br><span class="line"><span class="bash">--name nginx_server \</span></span><br><span class="line"><span class="bash">-d -p 8050:80 \</span></span><br><span class="line"><span class="bash">-v /mnt/docker/nginx/conf/nginx.conf:/etc/nginx/nginx.conf \</span></span><br><span class="line"><span class="bash">-v /mnt/docker/nginx/<span class="built_in">log</span>:/var/<span class="built_in">log</span>/nginx \</span></span><br><span class="line"><span class="bash">-v /mnt/docker/nginx/html/:/usr/share/nginx/html \</span></span><br><span class="line"><span class="bash">nginx</span></span><br><span class="line"><span class="number">1</span></span><br></pre></td></tr></table></figure>







<h3 id="docker-logs实时查看日志tail"><a href="#docker-logs实时查看日志tail" class="headerlink" title="docker logs实时查看日志tail"></a>docker logs实时查看日志tail</h3><p><code>docker logs -f -t --since=&quot;2017-05-31&quot; --tail=10 container</code></p>
<ul>
<li>说明</li>
</ul>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">--since : 指定输出日志开始日期。</span><br><span class="line">-f : 查看实时日志</span><br><span class="line">-t : 查看日志产生的时间戳</span><br><span class="line">-tail=10 : 查看最后的10条日志。</span><br><span class="line">container : 容器名</span><br></pre></td></tr></table></figure>

<hr>
<p><code>docker logs -f --until=2s</code></p>
<ul>
<li>说明：<br>相对时间(relative)：2013-01-02T13:23:37<br>绝对时间(timestamp)：42m for 42 minutes</li>
</ul>
<p><code>docker logs [OPTIONS] CONTAINER</code></p>
<hr>
<h3 id=""><a href="#" class="headerlink" title=""></a></h3></article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">李财</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://moneylee.gitee.io/myblog/2020/08/18/Docker%E9%83%A8%E7%BD%B2SpringBoot%E9%A1%B9%E7%9B%AE/">https://moneylee.gitee.io/myblog/2020/08/18/Docker%E9%83%A8%E7%BD%B2SpringBoot%E9%A1%B9%E7%9B%AE/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://moneylee.gitee.io/myblog" target="_blank">MoneyLee’s Blog</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"></div><div class="post_share"><div class="social-share" data-image="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl4zhjzuj30qy0e0gyz.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/myblog/2020/08/19/iOS%20AR%E5%92%8CARKit4/"><img class="prev-cover" src="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl0019wlj31ej0u0x6q.jpg" onerror="onerror=null;src='/myblog/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">iOS AR和ARKit4</div></div></a></div><div class="next-post pull-right"><a href="/myblog/2020/08/16/%E5%8E%8B%E5%8A%9B%E6%B5%8B%E8%AF%95%E5%B7%A5%E5%85%B7Jmeter5%E5%AD%A6%E4%B9%A0/"><img class="next-cover" src="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl4zhjzuj30qy0e0gyz.jpg" onerror="onerror=null;src='/myblog/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">压力测试工具Jmeter5学习</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="this.onerror=null;this.src='/myblog/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">李财</div><div class="author-info__description">开发者</div></div><div class="card-info-data is-center"><div class="card-info-data-item"><a href="/myblog/archives/"><div class="headline">文章</div><div class="length-num">46</div></a></div><div class="card-info-data-item"><a href="/myblog/tags/"><div class="headline">标签</div><div class="length-num">0</div></a></div><div class="card-info-data-item"><a href="/myblog/categories/"><div class="headline">分类</div><div class="length-num">10</div></a></div></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/xxxxxx"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://gitee.com/moneylee" target="_blank" title="Gitee"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:licai_1024@hotmail.com" target="_blank" title=""><i class="fas fa-envelope"></i></a><a class="social-icon" href="/myblog/img/mywechat.jpg" target="_blank" title=""><i class="fab fa-weixin"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#CentOS-%E5%AE%89%E8%A3%85-Docker"><span class="toc-number">1.</span> <span class="toc-text">CentOS 安装 Docker</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%90%AF%E5%8A%A8Docker-amp-%E8%AE%BE%E7%BD%AE%E4%B8%BA%E5%BC%80%E6%9C%BA%E8%87%AA%E5%90%AF"><span class="toc-number">2.</span> <span class="toc-text">启动Docker &amp; 设置为开机自启</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Docker-%E5%AE%89%E8%A3%85-MySql-5-7-%E5%A6%82%E6%9E%9C%E4%B8%8D%E5%86%99-5-7-%E5%88%99%E9%BB%98%E8%AE%A4%E6%8B%89%E5%8F%96%E6%9C%80%E6%96%B0%E7%89%88%E6%9C%AC"><span class="toc-number">3.</span> <span class="toc-text">Docker 安装 MySql 5.7 如果不写:5.7 则默认拉取最新版本</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%88%9B%E5%BB%BA%E5%B9%B6%E5%90%AF%E5%8A%A8%E4%B8%80%E4%B8%AAMySql-%E5%AE%B9%E5%99%A8"><span class="toc-number">4.</span> <span class="toc-text">创建并启动一个MySql 容器</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%BC%80%E5%90%AF%E5%A4%96%E7%BD%91%E8%AE%BF%E9%97%AE%E6%9D%83%E9%99%90"><span class="toc-number">5.</span> <span class="toc-text">开启外网访问权限</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%8C%82%E8%BD%BD%E6%95%B0%E6%8D%AE%E5%8D%B7%E4%BB%A5%E5%8F%8A%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6"><span class="toc-number">6.</span> <span class="toc-text">挂载数据卷以及配置文件</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%87%8D%E6%96%B0%E5%88%9B%E5%BB%BAMySql%E5%AE%B9%E5%99%A8%E5%B9%B6%E5%90%AF%E5%8A%A8"><span class="toc-number">7.</span> <span class="toc-text">重新创建MySql容器并启动</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%B0%86%E6%9C%AC%E5%9C%B0%E6%B5%8B%E8%AF%95%E6%95%B0%E6%8D%AE%E5%BA%93%E5%AF%BC%E5%85%A5%E5%88%B0%E6%9C%8D%E5%8A%A1%E5%99%A8Mysql%E6%95%B0%E6%8D%AE%E5%BA%93"><span class="toc-number">8.</span> <span class="toc-text">将本地测试数据库导入到服务器Mysql数据库</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%89%93%E5%8C%85%E5%B7%A5%E7%A8%8B-%E8%8E%B7%E5%8F%96Jar%E5%8C%85-%E6%B3%A8%E6%84%8F%E5%B7%A5%E7%A8%8B%E6%95%B0%E6%8D%AE%E5%BA%93%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E5%86%85%E5%9C%B0%E5%9D%80%E5%92%8C%E7%AB%AF%E5%8F%A3"><span class="toc-number">9.</span> <span class="toc-text">打包工程 获取Jar包 注意工程数据库配置文件内地址和端口</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%BC%96%E8%BE%91Dockerfile%E6%96%87%E4%BB%B6"><span class="toc-number">10.</span> <span class="toc-text">编辑Dockerfile文件</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%B0%86jar%E5%8C%85%E5%92%8Cdockerfile%E6%96%87%E4%BB%B6%E4%BC%A0%E8%BE%93%E5%88%B0%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%9A%84-mnt-docker-%E7%9B%AE%E5%BD%95%E4%B8%8B"><span class="toc-number">11.</span> <span class="toc-text">将jar包和dockerfile文件传输到服务器的 &#x2F;mnt&#x2F;docker 目录下</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%88%B6%E4%BD%9C%E9%95%9C%E5%83%8F"><span class="toc-number">12.</span> <span class="toc-text">制作镜像</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Docker%E5%AE%89%E8%A3%85Redis-%E5%B9%B6%E5%90%AF%E5%8A%A8%E6%9C%8D%E5%8A%A1"><span class="toc-number">13.</span> <span class="toc-text">Docker安装Redis 并启动服务</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%90%AF%E5%8A%A8%E9%95%9C%E5%83%8F"><span class="toc-number">14.</span> <span class="toc-text">启动镜像</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Docker-%E5%AE%89%E8%A3%85-Nginx"><span class="toc-number">15.</span> <span class="toc-text">Docker 安装 Nginx</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#docker-logs%E5%AE%9E%E6%97%B6%E6%9F%A5%E7%9C%8B%E6%97%A5%E5%BF%97tail"><span class="toc-number">16.</span> <span class="toc-text">docker logs实时查看日志tail</span></a></li><li class="toc-item toc-level-3"><a class="toc-link"><span class="toc-number">17.</span> <span class="toc-text"></span></a></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/myblog/2021/08/14/Flutter%E5%8F%91%E5%B8%83%E4%BB%A3%E7%A0%81%E5%88%B0%E4%BB%93%E5%BA%93/" title="Flutter发布代码到PUB仓库"><img src="http://file.moneylee.top/uPic/flutter.png" onerror="this.onerror=null;this.src='/myblog/img/404.jpg'" alt="Flutter发布代码到PUB仓库"/></a><div class="content"><a class="title" href="/myblog/2021/08/14/Flutter%E5%8F%91%E5%B8%83%E4%BB%A3%E7%A0%81%E5%88%B0%E4%BB%93%E5%BA%93/" title="Flutter发布代码到PUB仓库">Flutter发布代码到PUB仓库</a><time datetime="2021-08-14T12:04:03.000Z" title="发表于 2021-08-14 20:04:03">2021-08-14</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/myblog/2020/08/21/iOS%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/" title="iOS机器学习"><img src="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl0019wlj31ej0u0x6q.jpg" onerror="this.onerror=null;this.src='/myblog/img/404.jpg'" alt="iOS机器学习"/></a><div class="content"><a class="title" href="/myblog/2020/08/21/iOS%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/" title="iOS机器学习">iOS机器学习</a><time datetime="2020-08-21T02:04:10.000Z" title="发表于 2020-08-21 10:04:10">2020-08-21</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/myblog/2020/08/20/Docker%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86/" title="Docker 基础知识整理"><img src="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl4zhjzuj30qy0e0gyz.jpg" onerror="this.onerror=null;this.src='/myblog/img/404.jpg'" alt="Docker 基础知识整理"/></a><div class="content"><a class="title" href="/myblog/2020/08/20/Docker%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86/" title="Docker 基础知识整理">Docker 基础知识整理</a><time datetime="2020-08-20T12:12:02.000Z" title="发表于 2020-08-20 20:12:02">2020-08-20</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/myblog/2020/08/19/Flutter/" title="Flutter"><img src="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl0019wlj31ej0u0x6q.jpg" onerror="this.onerror=null;this.src='/myblog/img/404.jpg'" alt="Flutter"/></a><div class="content"><a class="title" href="/myblog/2020/08/19/Flutter/" title="Flutter">Flutter</a><time datetime="2020-08-19T02:04:03.000Z" title="发表于 2020-08-19 10:04:03">2020-08-19</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/myblog/2020/08/19/iOS%20AR%E5%92%8CARKit4/" title="iOS AR和ARKit4"><img src="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl0019wlj31ej0u0x6q.jpg" onerror="this.onerror=null;this.src='/myblog/img/404.jpg'" alt="iOS AR和ARKit4"/></a><div class="content"><a class="title" href="/myblog/2020/08/19/iOS%20AR%E5%92%8CARKit4/" title="iOS AR和ARKit4">iOS AR和ARKit4</a><time datetime="2020-08-19T02:04:03.000Z" title="发表于 2020-08-19 10:04:03">2020-08-19</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2022 By 李财</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/myblog/js/utils.js"></script><script src="/myblog/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js"></script><div class="js-pjax"></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>